package com.ruoyi.integration.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotBlank;

@Data
@Configuration
@Component
@ConfigurationProperties(prefix = "thirdparty.render-service")
public class MapRenderServiceProperties {

    private Endpoint endpoint = new Endpoint();
    private ApiRouter apiRouter = new ApiRouter();


    @Data
    public static class Endpoint {
        /**
         * 对应 yaml: thirdparty.render-service.endpoint.base-url
         * 注意：yaml 中的 base-url 会自动绑定到 baseUrl
         */
        @NotBlank
        private String baseUrl;
    }

    @Data
    public static class ApiRouter {
        /**
         * 对应 yaml: thirdparty.render-service.api-router.get-tif-z-range
         * hyphen -> 驼峰：get-tif-z-range -> getTifZRange
         */
        @NotBlank
        private String render;
    }
}
